package com.ruoyi.shop.clientuser.brokerage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.common.mapper.DtsCommissionMapper;
import com.ruoyi.mall.common.domain.DtsCommission;
import com.ruoyi.shop.clientuser.brokerage.service.IDtsCommissionService;

/**
 * 佣金Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-26
 */
@Service
public class DtsCommissionServiceImpl implements IDtsCommissionService
{
    @Autowired
    private DtsCommissionMapper dtsCommissionMapper;

    /**
     * 查询佣金
     *
     * @param id 佣金主键
     * @return 佣金
     */
    @Override
    public DtsCommission selectDtsCommissionById(Long id)
    {
        return dtsCommissionMapper.selectDtsCommissionById(id);
    }

    /**
     * 查询佣金列表
     *
     * @param dtsCommission 佣金
     * @return 佣金
     */
    @Override
    public List<DtsCommission> selectDtsCommissionList(DtsCommission dtsCommission)
    {
        return dtsCommissionMapper.selectDtsCommissionList(dtsCommission);
    }

    /**
     * 新增佣金
     *
     * @param dtsCommission 佣金
     * @return 结果
     */
    @Override
    public int insertDtsCommission(DtsCommission dtsCommission)
    {
        return dtsCommissionMapper.insertDtsCommission(dtsCommission);
    }

    /**
     * 修改佣金
     *
     * @param dtsCommission 佣金
     * @return 结果
     */
    @Override
    public int updateDtsCommission(DtsCommission dtsCommission)
    {
        dtsCommission.setUpdateTime(DateUtils.getNowDate());
        return dtsCommissionMapper.updateDtsCommission(dtsCommission);
    }

    /**
     * 批量删除佣金
     *
     * @param ids 需要删除的佣金主键
     * @return 结果
     */
    @Override
    public int deleteDtsCommissionByIds(Long[] ids)
    {
        return dtsCommissionMapper.deleteDtsCommissionByIds(ids);
    }

    /**
     * 删除佣金信息
     *
     * @param id 佣金主键
     * @return 结果
     */
    @Override
    public int deleteDtsCommissionById(Long id)
    {
        return dtsCommissionMapper.deleteDtsCommissionById(id);
    }
}
